﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Event
{

    class Program
    {
        
        static void Main(string[] args)
        {
            Car c = new Car();
            c.Running += c_Running;
            c.TunkIsFull += c_TunkIsFull;

            while (c.TunkFilledVolume < c.TunkMaxVolume)
            {
                Console.Write("Volume: ");
                c.AddFuel(int.Parse(Console.ReadLine()));
            }

            Console.WriteLine("Tunk Is Full");

            /*
             * var p = new Printer();
             * p.PrintStarted += (sender, e) => { Console.WriteLine("Print Started."); };
             * p.Printing += (sender, e) => 
             * { 
             *      Console.WriteLine("Printing {0} out of {1}.", e.Current, e.Total); 
             * };
             * p.PrintFinished += (sender, e) => { Console.WriteLine("Print Finished."); };
             * p.Print(5);
             */

            Console.ReadKey();
        }

        static void c_TunkIsFull(object sender, TunkIsFullEventArgs e)
        {
            Console.WriteLine("Overcharge: " + e.OverCharge);
        }

        static void c_Running(object sender, EventArgs e)
        {
            Console.WriteLine("Car is running");
        }
    }
}
